export function add(a, b) {
    return a + b;
}

export function getTitle(
    name,
    metaTitle,
    routes
) {
    const names = [];
    while (true) {
        names.push(metaTitle);
        const currentRouterObj = routes.find(
            (item) => item.meta.title === metaTitle
        );
        const parentRouterObj = routes.find(
            (item) => item.name === currentRouterObj?.meta?.parentRouter
        );
        if (parentRouterObj) {
            metaTitle = parentRouterObj.meta.title;
            continue;
        } else {
            break;
        }
    }
    return names.reverse();
}
